package maze.levels;

import java.applet.Applet;
import java.applet.AudioClip;
import java.io.IOException;
import java.net.URL;

/**
 *
 * @author loki
 */
public class Animal extends BaseTag {
    private AudioClip audio;
    
    public Animal(URL imageURL, String description, URL audioURL) throws IOException {
        super(imageURL, description);

        this.audio = Applet.newAudioClip(audioURL);
    }
    
    /**
     * 
     * @param loop wether or not the audio must be looped.
     */
    public void playAudio(boolean loop) {
        if(loop) {
            audio.loop();
        }
        else {
            audio.play();
        }
    }
    
    public void playAudio() {
        this.playAudio(false);
    }
}
